#pragma once

#include "SDL2/SDL.h"
#include "math.hh"

#include <string>

namespace sirtet
{

struct Graphics final
{
  private:
    SDL_Renderer *renderer;

  public:
    Graphics(SDL_Window *window);
    ~Graphics();

    SDL_Texture *load_png(const std::string &path);

    void clear(Color color);

    void draw_texture(SDL_Texture *texture, int x, int y, int width, int height);
    void draw_texture(SDL_Texture *texture, Rect<int> rect);

    void fill_rect(Color color, int x, int y, int width, int height);
    void fill_rect(Color color, const Rect<int> &rect);

    void present();

  private:
    void set_color(Color color);
};

} // namespace sirtet
